#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
using namespace std;

const ll N = 1e4 + 10, INF = 0x3f3f3f3f, mod = 998244353;

ll n, k, m;
string s;
ll f[N][110][20];
ll ne[N];

void solve()
{
    cin >> n >> k >> s;
    m = s.size();
    s = " " + s;
    for (ll i = 2, j = 0;i <= m;i++) {
        while (j && s[i] != s[j + 1]) j = ne[j];
        if (s[i] == s[j + 1]) j++;
        ne[i] = j;
    }

    f[0][0][0] = 1;
    for (ll i = 0;i < n;i++)
        for (ll j = 0;j <= m;j++)
            for (ll z = 0;z <= k;z++)
                for (ll ch = 0;ch < 26;ch++) {
                    ll flag = 0;
                    for (ll p = j;1;p = ne[p]) {
                        if (s[p + 1] == (char)(ch + 'a')) {
                            if (p + 1 == m)  (f[i + 1][0][z + 1] += f[i][j][z]) %= mod;
                            else (f[i + 1][p + 1][z] += f[i][j][z]) %= mod;
                            flag = 1;
                            break;
                        }
                        if (p == 0) break;
                    }
                    if (flag) continue;
                    (f[i + 1][0][z] += f[i][j][z]) %= mod;
                }

    ll ans = 0;
    for (ll i = 0;i < m;i++) {
        (ans += f[n][i][k]) %= mod;
    }
    cout << ans;
}
signed main()
{
    //ios::sync_with_stdio(0);
    //cin.tie(0);cout.tie(0);
#define ONLINE_JUDGE
#ifndef ONLINE_JUDGE
    std::istringstream in(R"()");
    std::cin.rdbuf(in.rdbuf());
#endif
    ll T = 1;
    //cin>>T;
    for (ll i = 1;i <= T;i++) {
        solve();
    }
}